/**
 * Apr 15, 2010
 */
package org.tomale.id.power.customers.inquiry.ui;

import java.awt.SystemColor;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.part.ViewPart;
import org.tomale.id.power.customers.inquiry.CustomerInquiry;

/**
 * @author ferd
 *
 */
public class CustomerView extends ViewPart {

	public static final String VIEW_ID = "org.tomale.id.power.customers.inquiry.customer";
	
	Text _acct;
	Text _name;
	Text _address;
	Text _meter;
	Text _meterSerial;
	Text _pole;
	Text _lc;
	Text _state;
	Text _type;
	
	private CustomerInquiry _inquiry;
	
	/* (non-Javadoc)
	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
	 */
	@Override
	public void createPartControl(Composite parent) {
		GridLayout layout = new GridLayout();
		layout.numColumns = 2;
		parent.setLayout(layout);
		
		Label l;

		// account
		l = new Label(parent, SWT.NONE);
		l.setText("Account");
		l.setLayoutData(new GridData(SWT.BEGINNING,SWT.CENTER,
				false,false));
		
		_acct = new Text(parent, SWT.BORDER | SWT.SEARCH);
		_acct.setLayoutData(new GridData(SWT.FILL,SWT.BEGINNING,
				true,false));
		
		// name
		l = new Label(parent, SWT.NONE);
		l.setText("Name");
		l.setLayoutData(new GridData(SWT.BEGINNING,SWT.CENTER,
				false,false));
		
		_name = new Text(parent, SWT.BORDER | SWT.SEARCH);
		_name.setLayoutData(new GridData(SWT.FILL,SWT.BEGINNING,
				true,false));
		
		// address
		l = new Label(parent, SWT.NONE);
		l.setText("Address");
		l.setLayoutData(new GridData(SWT.BEGINNING,SWT.CENTER,
				false,false));
		
		_address = new Text(parent, SWT.BORDER | SWT.SEARCH);
		_address.setLayoutData(new GridData(SWT.FILL,SWT.BEGINNING,
				true,false));
		
		// meter
		l = new Label(parent, SWT.NONE);
		l.setText("Meter");
		l.setLayoutData(new GridData(SWT.BEGINNING,SWT.CENTER,
				false,false));
		
		_meter = new Text(parent, SWT.BORDER | SWT.SEARCH);
		_meter.setLayoutData(new GridData(SWT.FILL,SWT.BEGINNING,
				true,false));
		
		// meter serial
		l = new Label(parent, SWT.NONE);
		l.setText("Meter Serial");
		l.setLayoutData(new GridData(SWT.BEGINNING,SWT.CENTER,
				false,false));
		
		_meterSerial = new Text(parent, SWT.BORDER | SWT.SEARCH);
		_meterSerial.setLayoutData(new GridData(SWT.FILL,SWT.BEGINNING,
				true,false));
		
		// pole
		l = new Label(parent, SWT.NONE);
		l.setText("Pole");
		l.setLayoutData(new GridData(SWT.BEGINNING,SWT.CENTER,
				false,false));
		
		_pole = new Text(parent, SWT.BORDER | SWT.SEARCH);
		_pole.setLayoutData(new GridData(SWT.FILL,SWT.BEGINNING,
				true,false));
	}

	/* (non-Javadoc)
	 * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
	 */
	@Override
	public void setFocus() {
		// TODO Auto-generated method stub

	}
	
	public CustomerInquiry getInquiry(){
		if(_inquiry == null){
			_inquiry = CustomerInquiry.getInstance();
		}
		return _inquiry;
	}
}
